package com.tqyan.model.controller.request;

import com.alibaba.fastjson.JSONObject;
import com.tqyan.model.enums.GPTSizeEnum;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @description OpenAI聊天请求
 * <p>
 *     {
 *     "prompt": "A giant panda is munching on bamboo.",
 *     "n": 1,
 *     "size": "1024x1024"
 *   }
 * </p>
 *
 * @author 陈晨
 * @date 2023/4/10 16:55
 */
@Data
@Slf4j
public class OpenAIDrawRequest implements Serializable {
    private static final long serialVersionUID = 9091025787277462602L;

    /** 绘画需求 */
    private String prompt;
    /** 图片数 */
    private Integer n;
    /** 绘画尺寸 */
    private String size;

    /**
     * @description 获取请求体
     * <p> <功能详细描述> </p>
     *
     * @author 陈晨
     * @date 2023/4/12 15:41
     */
    public static String getRequestBody(OpenAIDrawRequest drawRequest) {
        String requestJson = JSONObject.toJSONString(drawRequest);
        log.info("[GPT请求] drawRequest={}, 请求内容", requestJson);
        return requestJson;
    }

}


